<template>
	<button class="btn btn-sm btn-primary" @click="newBanner">新增迷你组合Banner</button>
  <vue-modal
    title="新增迷你组合Banner"
    ok-text="提交"
    cancel-text="取消"
    :show.sync="showNewBannerModal"
    effect="fade"
    :small="true"
    :width="500"
    :callback="submit">
    <div slot="modal-body" class="modal-body">
      <form class="form-horizontal" role="form">
        <div class="form-group form-group-sm">
          <label class="col-sm-3 control-label">*Banner标题</label>
          <div class="col-sm-9 text-left">
            <input type="text" class="form-control" v-model="banner.title">
          </div>
        </div>
        <div class="form-group form-group-sm">
          <label class="col-sm-3 control-label">*Banner图片</label>
          <div class="col-sm-9 text-left">
            <input type="file" class="form-control" accept="image/jpeg,image/png" v-model="banner.file" v-el:file>
          </div>
        </div>
        <div class="form-group form-group-sm">
          <label class="col-sm-3 control-label">*跳转内容类型</label>
          <div class="col-sm-9">
            <select class="form-control" v-model="banner.type">
              <option value="-1">请选择</option>
              <option value="1">CMS文章</option>
              <option value="2">第三方网址</option>
              <option value="3">金贝塔</option>
              <option value="4">用户</option>
              <option value="7">话题</option>
              <option value="8">动态</option>
              <option value="9">股市直播</option>
              <option value="10">迷你组合</option>
              <option value="11">存股宝</option>
              <option value="12">文章栏目</option>
            </select>
          </div>
        </div>
        <div class="form-group form-group-sm" v-if=" +banner.type !== -1 && +banner.type !== 9">
          <label class="col-sm-3 control-label">*{{banner.type | adTypeTargetCase}}</label>
          <div class="col-sm-9 text-left">
            <input type="text" class="form-control" v-model="banner.location">
          </div>
        </div>
        <div class="form-group form-group-sm">
          <label class="col-sm-3 control-label">*外部浏览器打开</label>
          <div class="col-sm-9 text-left">
            <select class="form-control" v-model="banner.forceExternalBrowser">
              <option value="0" selected>否</option>
              <option value="1">是</option>
            </select>
          </div>
        </div>
      </form>
    </div>
  </vue-modal>
</template>
<style src="./mini-banner-new.css" scoped></style>
<script src="./mini-banner-new.js"></script>